<!DOCTYPE html>
<html lang="zh">

<head>
	<meta charset="UTF-8">
	<meta content="width=device-width, initial-scale=1.0" name="viewport">
	<title>admin</title>
	<link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet" />
	<link href="https://cdn.staticfile.org/bootswatch/5.1.3/darkly/bootstrap.min.css"
		media="(prefers-color-scheme: dark)" rel="stylesheet" />
	<style>
		body,
		input,
		textarea {
			font-family: "Microsoft JhengHei", "Meiryo", "Malgun Gothic", "Dotum", "MS PGothic", "PMingLiu", sans-serif;
		}

		body {
			background-color: #888;
		}

		@media (prefers-color-scheme: dark) {
			body {
				background: #222;
			}
		}
	</style>
</head>

<body>

	<div class="container my-4">
		<div id="return_msg"></div>
		<a class="btn btn-primary m-1" href="edit_log.html" role="button">修改记录(测试版)</a>
		<a class="btn btn-primary m-1" href="../admin_old/" role="button">若有问题，点此进入旧版后台</a>

		<div class="card shadow mb-3" id="form1">
			<div class="card-header text-center">登入</div>
			<div class="card-body">
				<div class="form-group">
					<label for="login_cid">雀庄编号</label>
					<select class="form-select mb-1" id="login_select" onchange="login_select_change()">
						<option selected value="0">请选择</option>
					</select>
					<input class="form-control" id="login_cid" placeholder="數字" type="number">
				</div>
				<div class="form-group">
					<label for="login_passwd">密碼</label>
					<input class="form-control" id="login_passwd" placeholder="密碼" type="password">
				</div>
			</div>
			<div class="card-footer">
				<div class="d-grid gap-2 col-6 mx-auto">
					<input class="btn btn-primary btn-block" id="login_button" onclick="login()" type="button"
						value="登入" />
				</div>

			</div>
		</div>
		<div class="accordion d-none" id="accordionExample">
			<input class="btn btn-primary m-1" onclick="localStorage.removeItem('rate_pw');location.reload();"
				type="button" value="登出" />

			<div class="accordion-item" id="form3">
				<h2 class="accordion-header" id="headingTwo">
					<button class="accordion-button" type="button" data-bs-toggle="collapse"
						data-bs-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
						导入新记录
					</button>
				</h2>
				<div id="collapseTwo" class="accordion-collapse collapse show" aria-labelledby="headingTwo"
					data-bs-parent="#accordionExample">
					<div class="accordion-body">
						<h4>导入新记录
							<a href="https://docs.qq.com/doc/DZEVuYWFlQmR4em5v" target="_blank">说明</a>
						</h4>
						张三 李四 王五 赵六<br />
						27000 26000 24000 23000<br />
						320 321 322 37<br />
						<small class="text-muted">
							分数，可以缩小100倍或1000倍
						</small>

						<textarea class="form-control mb-3" id="logtext" name="logtext" rows="4"
							onchange="log_gen_table()"></textarea>

						<table class="table table-striped table-hover table-bordered table-sm mt-3 text-cent">
							<thead>
							</thead>
							<tbody id="table_new_log">
							</tbody>
						</table>
						<div class="d-grid gap-2 col-6 mx-auto">
							<input id="multi_input" class="btn btn-primary" onclick="addlog()" type="button" disabled
								value="请先输入记录"></input>
						</div>
					</div>
				</div>
			</div>
			<div class="accordion-item">
				<h2 class="accordion-header" id="headingOne">
					<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
						data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
						雀庄信息设置
					</button>
				</h2>

				<div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne"
					data-bs-parent="#accordionExample">
					<form class="accordion-item shadow" id="form2">
						<div class="accordion-body">
							<h4>基本設置</h4>
							<div class="row">
								<div class="form-group col">
									<label for="i_name">雀庄名称</label>
									<input class="form-control" id="i_name" name="name" type="text" value="">
								</div>
								<div class="form-group col">
									<label for="i_pw">管理密碼</label>
									<input class="form-control" id="i_pw" name="new_pw" type="text" value="">
								</div>
							</div>
							<div class="collapse" id="area_tips">
								<div class="alert alert-info" role="alert">
									华北：北京/天津/河北/山西/内蒙古<br>
									东北：辽宁/吉林/黑龙江<br>
									华东：上海/江苏/浙江/安徽/福建/江西/山东/台湾<br>
									华中：河南/湖北/湖南<br>
									华南：广东/海南/广西/香港/澳门<br>
									西部：重庆/四川/贵州/云南/西藏/陕西/甘肃/青海/宁夏/新疆
								</div>
							</div>
							<div class="row">
								<div class="form-group col">
									<label for="i_ctype">地域
										<button aria-controls="area_tips" aria-expanded="false"
											class="btn btn-info btn-sm" data-bs-target="#area_tips"
											data-bs-toggle="collapse" type="button">
											说明
										</button>
									</label>


									<select class="form-select mr-sm-2" id="i_ctype" name="ctype">
										<option value="0">其他</option>
										<option value="1">华北</option>
										<option value="2">东北</option>
										<option value="3">华东</option>
										<option value="4">中南</option>
										<option value="5">西部</option>
									</select>
								</div>
								<div class="col form-group">
									<label for="i_area_name">城市</label>
									<input class="form-control" id="i_area_name" name="area_name" placeholder="≤30字"
										type="text" />
								</div>
							</div>

							<div class="row mt-2">
								<div class="form-group col">
									<label for="i_status">雀庄狀態</label>
									<select class="form-select mr-sm-2" id="i_status" name="status">
										<option value="0">不在首页显示</option>
										<option value="1">通常在周末营业</option>
										<option value="2">全天营业</option>
										<option value="3">暂时闭店</option>
										<option value="4">永久闭店</option>
									</select>
								</div>

								<div class="col form-group">
									<label for="i_qqgroup">雀庄QQ群</label>
									<input class="form-control" id="i_qqgroup" name="qqgroup" placeholder="數字"
										type="text" />
								</div>
							</div>
							<div class="form-group">
								<label for="i_address">雀庄地址</label>
								<input class="form-control" id="i_address" name="address" type="text" value="">
							</div>


							<div class="row">
								<div class="col">
									<label for="i_east">雀庄经度</label>
									<input class="form-control" id="i_east" name="east" type="text" value="" />
								</div>
								<div class="col">
									<label for="i_north">雀庄纬度</label>
									<input class="form-control" id="i_north" name="north" type="text" value="" />
								</div>
							</div>
							<div class="row mt-3">
								<div class="form-group col">
									<label for="i_admins">雀庄介绍</label>
									<textarea class="form-control" id="i_rule" name="rule" rows="5"></textarea>
									<small class="text-muted">
										※支持markdown語法
										<a href="https://www.jianshu.com/p/f3147a804368" target="_blank">具體看這</a>
									</small>
								</div>
								<div class="form-group col">
									<label for="i_admins">管理员QQ</label>
									<textarea class="form-control" id="i_admins" name="admins" rows="5"></textarea>
									<small class="text-muted">
										用空格或回车隔开
									</small>
								</div>
							</div>


							<div class="row mb-0">
								<div class="form-group col">
									<label for="i_numerator">活跃度,分子</label>
									<input class="form-control" id="i_numerator" name="numerator" type="text"
										value="" />

								</div>
								<div class="form-group col">
									<label for="i_denominator">活跃度,分母</label>
									<input class="form-control" id="i_denominator" name="denominator" type="text"
										value="" />
								</div>
							</div>
							<small class="text-muted">
								【活跃度】分子分母 输入 2/7 表示一星期，有2天雀庄营业。输入 15/30 表示一个月有15天营业。
							</small>
							<hr />
							<h4>雀庄状况</h4>

							<div class="form-check mb-3">
								<input class="form-check-input" id="charge_by_hour" type="checkbox">
								<label class="form-check-label" for="charge_by_hour">选中=按小时收费/非选中=按半庄收费</label>
							</div>

							<div class="row">
								<div class="form-group col">
									<div class="form-check">
										<input class="form-check-input" id="no_smoking" type="checkbox">
										<label class="form-check-label" for="no_smoking">禁止抽烟</label>
									</div>
								</div>

								<div class="form-group col">
									<div class="form-check">
										<input class="form-check-input" id="order_first" type="checkbox">
										<label class="form-check-label" for="order_first">必须事先预约</label>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="form-group col">
									<div class="form-check">
										<input class="form-check-input" id="scoreboard" type="checkbox">
										<label class="form-check-label" for="scoreboard">有数显麻将机</label>
									</div>
								</div>

								<div class="form-group col">
									<div class="form-check">
										<input class="form-check-input" id="ban_gambling" type="checkbox">
										<label class="form-check-label" for="ban_gambling">严禁赌博</label>
									</div>
								</div>

							</div>
						</div>
						<div class="card-footer text-center">
							<input class="btn btn-primary btn-block" onclick="before_post()" type="button" value="提交" />
						</div>
					</form>
				</div>
			</div>
			<div class="accordion-item" id="form5">
				<h2 class="accordion-header" id="headingThree">

					<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
						data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
						批量删除记录+批量删除成员+批量改手机号
					</button>

				</h2>

				<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree"
					data-bs-parent="#accordionExample">
					<div class="accordion-body">
						<h4>批量删除记录+批量删除成员+批量改手机号</h4>
						<small class="text-muted">
							【批量删除成员】：輸入手機號
							【例】12344443333 12344446666<br>
							【批量删除记录】：輸入編號（記錄頁面#123字樣的東西）
							【例】122 123 22<br>
							【批量改手机号】：原手机号+新手机号 原手机号+新手机号
							【例】12344443333 12344446666 12344443333 12344446666<br>
							用【空格/回車】分隔，記得取消【不刪除】
						</small>
						<textarea class="form-control mb-3" id="deltext" rows="2"></textarea>
						<div class="input-group">
							<select class="form-select" id="del_type" name="delete_type">
								<option selected value="0">不刪除</option>
								<option value="1">刪除記錄</option>
								<option value="2">刪除成員</option>
								<option value="3">改手机号（测试中）</option>
							</select>
							<div class="input-group-append">
								<button class="btn btn-primary" onclick="del_log_or_member()" type="button">操作</button>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="accordion-item" id="form4">
				<h2 class="accordion-header" id="heading4">

					<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
						data-bs-target="#collapse4" aria-expanded="false" aria-controls="collapse4">
						批量添加/修改会员
					</button>
				</h2>

				<div id="collapse4" class="accordion-collapse collapse" aria-labelledby="heading4"
					data-bs-parent="#accordionExample">
					<div class="accordion-body">
						<h3>批量添加/修改会员
							<button class="btn btn-info btn-sm" data-bs-target="#new_menber_tips"
								data-bs-toggle="collapse" type="button">
								显示说明
							</button>
						</h3>
						<h5>【特别注意！！】添加/删除会员，都不会对【对战记录】产生影响！你可以理解为：给手机号取个名字。手机号有错误，请用手机号请用【修改手机号】他才能把【对战记录】里的手机号换掉</h5>
						<div class="collapse" id="new_menber_tips">
							<div class="alert alert-info" role="alert">
								如果手机号【不在】会员列表里，则会【添加新会员】<br>
								如果手机号【存在】会员列表里，则会【修改此人的信息】<br>
								可以批量添加，批量修改，或者两者混合<br>
								每行依次：手机号(必填) 昵称(必填) QQ号(选填) 积分(选填) 余额(选填)
								【例1 无QQ 积分100】12300001111 张三 = 100<br>
								【例2】12300001111 李四 123456789
							</div>
						</div>
						手机号 昵称 QQ号 积分 余额<br>
						<div class="form-group">
							<textarea class="form-control" id="new_member_textarea" name="new_member_textarea"
								rows="3"></textarea>
							<small class="text-muted">
								上方数据 与 电子表格/在线表格 可以互相粘贴
							</small>
						</div>
						<button class="btn btn-primary" onclick="addmember()" type="button">提交</button>
					</div>
				</div>
			</div>

			<div class="accordion-item" id="form6">
				<h2 class="accordion-header" id="heading5">

					<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
						data-bs-target="#collapse5" aria-expanded="false" aria-controls="collapse5">
						修改会员信息
					</button>
				</h2>

				<div id="collapse5" class="accordion-collapse collapse" aria-labelledby="heading5"
					data-bs-parent="#accordionExample">
					<div class="accordion-body">
						<h5>【特别注意！！】添加/删除会员，都不会对【对战记录】产生影响！你可以理解为：给手机号取个名字。手机号有错误，请用手机号请用【修改手机号】他才能把【对战记录】里的手机号换掉</h5>
						<table class="table table-striped table-hover table-bordered table-sm mt-3 text-cent">
							<thead>
								<tr>
									<th scope="col">手机号</th>
									<th scope="col">昵称</th>
									<th scope="col">QQ</th>
									<th scope="col">积分</th>
									<th scope="col">余额</th>
								</tr>
							</thead>
							<tbody id="table_data">
								<tr>
									<td>
										<div class="form-check">
											<input class="form-check-input" id="flexCheckDefault" type="checkbox"
												value="">
											<label class="form-check-label" for="flexCheckDefault">12300001111</label>
										</div>
									</td>
									<td contenteditable="true">张三</td>
									<td contenteditable="true">123456789</td>
									<td contenteditable="true">0</td>
									<td contenteditable="true">0</td>
								</tr>
							</tbody>
						</table>
						<button class="btn btn-primary" onclick="new_row()" type="button">添加新成员</button>
						<button class="btn btn-danger" onclick="delete_select()" type="button">删除选中会员</button>
						<button class="btn btn-primary" onclick="save_table()" type="button">保存</button>
					</div>
				</div>
			</div>

		</div>


	</div>
	<script src="../js/data_list.js"></script>
	<script crossorigin="anonymous" src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
	<script crossorigin="anonymous"
		src="https://cdn.staticfile.org/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
	<script src="admin.js"></script>

</body>

</html>